//评论
jQuery(document).ready(function($){
	//open popup
	$('.cd-popup-trigger').on('click', function(event){
		if(!setCurrentLine($(this))){
			return false;
		}
		event.preventDefault();
		$('#commentBox').fadeIn(300);
		$('#commentBox #comment').fadeIn(300);
		$('#commentBox').find("input:text,textarea").val("");
	});
	
	//close popup
	$('.cd-popup').on('click', function(event){
		if( $(event.target).is('.cd-popup-close') || $(event.target).is('#commentBox') ) {
			event.preventDefault();
			$(this).fadeOut(300);
			$('#commentBox #comment').fadeOut(300);
			resetStar();   //评分框重置
		}
	});
	
	//close popup when clicking the esc keyboard button
	$(document).keyup(function(event){
    	if(event.which=='27'){
    		$('.cd-popup').removeClass('is-visible');
			$('.cd-popup .cd-popup-container').removeClass('cis-visible');
			resetStar();   //评分框重置
	    }
    });
});
//追加评论457
jQuery(document).ready(function($){
	//open popup
	$('.cd-popup-trigger1').on('click', function(event){
		if(!setCurrentLine($(this))){
			return false;
		}
		event.preventDefault();
		$('#addCommentBox').fadeIn(300);
		$('#addCommentBox #addComment').fadeIn(300);
		$('#addCommentBox').find("input:text,textarea").val("");
	});
	
	//close popup
	$('#addCommentBox').on('click', function(event){
		if( $(event.target).is('.cd-popup-close') || $(event.target).is('#addCommentBox') ) {
			event.preventDefault();
			$(this).fadeOut(300);
			$('#addCommentBox #addComment').fadeOut(300);
		}
	});
	/*$('.c_p_c').on('click', function(event){
		
			$('.cd-popup1').removeClass('is-visible');
			$('.cd-popup1 .cd-popup-container').removeClass('cis-visible');
		
	});暂时没发现有什么用处15.11.10*/
	$(document).keyup(function(event){
    	if(event.which=='27'){
    	$('#addCommentBox').fadeOut(300);
		$('#addCommentBox #addComment').fadeOut(300);
	    }
    });
});
//违规举报
jQuery(document).ready(function($){
	//open popup
	$('.cd-popup-trigger4').on('click', function(event){
		if(!setCurrentLine($(this))){
			return false;
		}
		event.preventDefault();
		$('#violationReportBox').fadeIn(300);
		$('#violationReportBox #violationReport').fadeIn(300);
		$('#violationReportBox').find("input:text,textarea").val("");
	});
	
	//close popup
	$('#violationReportBox').on('click', function(event){
		if( $(event.target).is('.cd-popup-close') || $(event.target).is('#violationReportBox') ) {
			event.preventDefault();
			$(this).fadeOut(300);
			$('#violationReportBox #violationReport').fadeOut(300);
		}
	});
	//close popup when clicking the esc keyboard button
	$(document).keyup(function(event){
    	if(event.which=='27'){
    		$('#violationReportBox').fadeOut(300);
			$('#violationReportBox #violationReport').fadeOut(300);
	    }
    });
});


